import Taro from '@tarojs/taro'
import { View } from '@tarojs/components'
import './index.less'
import OrderList from '../../components/OrderList/index';
import api from '../../service/api';

export default class UserOrder extends Taro.Component {

  config = {
    navigationBarTitleText: '我的问诊'
  }

  constructor() {
    super(...arguments)
    this.state = {
        orderList:[],
        CurrentTab: 0
    }
  }

  componentDidMount(){
    let params = {}
    params.userId = Taro.getStorageSync('loginInfo').userId
    params.role = Taro.getStorageSync('loginInfo').role
    api.get('/inquiry/find/OrderStatus', params).then(res=>{
      this.setState({
        orderList:res.data.data
      })
    })
  }


  render() {
    return (
      <View className='page'>
        <View className='page-top'>
        </View>
        <View className='page-main'>
          <OrderList data={this.state.orderList}></OrderList>
        </View>
        <View className='page-bottom'>
          <Login show={true}></Login>
        </View>
      </View>
    )
  }
}

